#ifndef MESSSOCKET
#define MESSSOCKET
#include "Message.h"
#include <string>

using namespace std;

class TcpSocket
{
private:
    int connFd;
public:
    TcpSocket();
    TcpSocket(int connFd);
    ~TcpSocket();
    void connectServe(string ip,int port, int timeout);
    //发消息
    int sendMag(Message* message,int timeout);

    //收信息
    Message* receiveMag(int timeout);

    int getConnFd();
};

#endif